package creationalPatterns.FactoryPattern;


class ShapeFactory {
    public Shape getShape(String shapeType){
//        if (shapeType == null){
//            return null;
//        }
        if(shapeType.equalsIgnoreCase("Circle")){
            return new Circle();
        } else if (shapeType.equalsIgnoreCase("RECTANGLE")) {
            return new Ractangle();
        } else if (shapeType.equalsIgnoreCase("SQUARE")) {
            return new Square();
        }
        return null;
    }

}
public interface Shape {
    void draw();
}

class Ractangle implements Shape {

    @Override
    public void draw() {
        System.out.println(" Ractangle::draw");
    }
}

class Square implements Shape {

    @Override
    public void draw() {
        System.out.println(" Square::draw");
    }
}
class Circle implements Shape{
    @Override
    public void draw() {
        System.out.println(" Circle::draw");
    }
}